<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var str1 = new String();
        var str2 = new String();
        str1 = '1';
        str2 = '2'
        console.log(str1+str2);
        function add (a, b) {
            return Number(a)+Number(b)
        }
        var res = add(str1, str2);
        console.log(res);
        String.prototype.myPlus = add;
        var str3 = new String();
        var str4 = new String();
        // 修改String之后要重新new 生成一个新的实例 在这个新的实例中，添加的方法和属性才会生效
        console.log(str3.myPlus(str1, str2));
    </script>
</body>
</html>